package lq;

import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.Temporal;
import java.util.*;

import static java.lang.System.in;

/**
 * @author small瑞
 */

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(in);
        int n = scanner.nextInt();
        Set<Integer> set = new HashSet<>();
        set.add(scanner.nextInt());
        for(int i = 0 ; i < n-1 ; i++){
            List<Integer> cur = new ArrayList<>(set);
            int index = scanner.nextInt();
            for(Integer j : cur){
                set.add(index);
                set.add(index+j);
                if(Math.abs(j - index)!=0){
                    set.add(Math.abs(j - index));
                }
            }
        }
        System.out.println(set.size());

        /*
        Scanner scanner = new Scanner(in);
        long index = scanner.nextLong();
        long second = (index/1000)%60;
        long minute = (index/60000)%60;
        long hour   = (index/3600000)%24;
        System.out.println(new DecimalFormat("00").format(hour) + ":" + new DecimalFormat("00").format(minute) + ":" +new DecimalFormat("00").format(second));

         */
        /*
        Set<String>set = new HashSet<>();
        List<String>arr = new ArrayList<String>();

        for(int i = 0 ; i < 20 ; i++) {
            for(int j = 0 ; j < 21 ; j++) {
                StringBuilder sb = new StringBuilder();
                if(i<10) {
                    sb.append(0);
                    sb.append(i);
                }
                else {
                    sb.append(i);
                }
                if(j<10) {
                    sb.append(0);
                    sb.append(j);
                }
                else {
                    sb.append(j);
                }

                arr.add(sb.toString());
            }
        }
        System.out.println(arr);
        int i = 0 ;
        while(i < arr.size()-1) {
            double x1 = Double.parseDouble(arr.get(i).substring(0,2));
            double y1 = Double.parseDouble(arr.get(i).substring(2));
            for(int j = i + 1 ; j < arr.size() ; j++) {
                double x2 = Double.parseDouble(arr.get(j).substring(0,2));
                double y2 = Double.parseDouble(arr.get(j).substring(2));
                if(x2-x1==0) {
                    continue;
                }
                double slope = (y2-y1)/(x2-x1);
                double intercept = y1 - slope*x1;
                StringBuilder sb = new StringBuilder();
                sb.append(slope);
                sb.append(":");
                sb.append(intercept);
                set.add(sb.toString());
            }
            i++;
        }
        System.out.println(set);
        System.out.println(set.size() + 3);
         */


    }
}
